//
//  VideoCell.m
//  ErWa
//
//  Created by 赵颜彬 on 16/3/10.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "VideoCell.h"

@implementation VideoCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.title = [[UILabel alloc] init];
        [self.contentView addSubview:_title];
        
        self.imgView = [[UIImageView alloc] init];
        [self.contentView addSubview:_imgView];
        
        
        self.playBtn = [UIButton buttonWithType:0];
        [self.contentView addSubview:_playBtn];
        
        
        self.content = [[UILabel alloc] init];
        [self.contentView addSubview:_content];
        
        self.guest = [[UILabel alloc] init];
        [self.contentView addSubview:_guest];
        
        self.length = [[UILabel alloc] init];
        [self.contentView addSubview:_length];

    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    
    _title.frame = CGRectMake(15, 10, self.contentView.frame.size.width - 20, 50);
    _title.font = [UIFont systemFontOfSize:22];
    _title.numberOfLines = 0;
    
    _imgView.frame = CGRectMake(20, _title.frame.origin.y + _title.frame.size.height + 5, self.contentView.frame.size.width - 40, 170);
    _imgView.layer.borderColor = [UIColor colorWithRed:255/255. green:228/255. blue:225/255. alpha:.8].CGColor;
    _imgView.layer.borderWidth = 10;
    _imgView.layer.cornerRadius = 5;
    _imgView.clipsToBounds = YES;
    _imgView.userInteractionEnabled = YES;
    
    _playBtn.frame = CGRectMake(0, 0, 50, 50);
    _playBtn.center = _imgView.center;
    [_playBtn setBackgroundImage:[UIImage imageNamed:@"iconfont-bofang.png"] forState:UIControlStateNormal];
    
        _content.frame = CGRectMake(15, _imgView.frame.size.height + 30, self.contentView.frame.size.width  - 25, 200 + 5);
    _content.numberOfLines = 0;
    _content.font = [UIFont systemFontOfSize:16.];
    _guest.frame = CGRectMake(10, _imgView.frame.size.height +180 + 10, 150, 25);
    
    _length.frame = CGRectMake(_guest.frame.size.width + 80, _guest.frame.origin.y, self.contentView.frame.size.width - _guest.frame.size.width - 80 - 10, 20);
    _length.textAlignment = NSTextAlignmentRight;
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
